#define _CRT_SECURE_NO_WARNINGS

#include"DlnkList.h"

void Test1()
{
	LTNode* plist = InitLT();
	PrintLT(plist);

	PushBackLT(plist, 1);
	PushBackLT(plist, 2);
	PushBackLT(plist, 5);
	PushBackLT(plist, 5);
	PrintLT(plist);

	PopBackLt(plist);
	PopBackLt(plist);
	PopBackLt(plist);

	PrintLT(plist);


	DestroyLT(plist);
	plist = NULL;
}

void Test2()
{
	LTNode* plist = InitLT();
	PrintLT(plist);

	PushFrontLt(plist, 1);
	PushFrontLt(plist, 2);
	PushFrontLt(plist, 5);
	PushFrontLt(plist, 4);
	PrintLT(plist);

	PopFrontLT(plist);
	PopFrontLT(plist);
	PopFrontLT(plist);
	PrintLT(plist);


	DestroyLT(plist);
	plist = NULL;
}

void Test3()
{
	LTNode* plist = InitLT();
	PrintLT(plist);

	PushFrontLt(plist, 1);
	PushFrontLt(plist, 2);
	PushFrontLt(plist, 5);
	PrintLT(plist);

	LTNode* pos1 = FindLT(plist, 2);
	LTNode* pos2 = FindLT(plist, 5);
	InsertLT(pos1, 8);
	InsertLT(pos2, 9);
	PrintLT(plist);

	EraseLT(pos1);
	pos1 = NULL;
	EraseLT(pos2);
	pos2 = NULL;
	PrintLT(plist);


	DestroyLT(plist);
	plist = NULL;
}


int main()
{
	Test2();
	return 0;
}